//SPDX-FileCopyrightText: Copyright 2022-2024 深圳市同心圆网络有限公司
//SPDX-License-Identifier: GPL-3.0-only

package dataview_dao

import "go.mongodb.org/mongo-driver/mongo"

var ViewDao *_ViewDao
var NodeDao *_NodeDao
var EdgeDao *_EdgeDao
var ChatMsgIndexDao *_ChatMsgIndexDao

func InitDao(mgoDb *mongo.Database) (err error) {
	ViewDao, err = newViewDao(mgoDb)
	if err != nil {
		return
	}
	NodeDao, err = newNodeDao(mgoDb)
	if err != nil {
		return
	}
	EdgeDao, err = newEdgeDao(mgoDb)
	if err != nil {
		return
	}
	ChatMsgIndexDao, err = newChatMsgIndexDao(mgoDb)
	if err != nil {
		return
	}

	return
}
